package JeuInterfaces;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PartieReseauInfos extends JDialog{

	public PartieReseauInfos() {
		this.setSize(new Dimension(200,100));
		this.setTitle("Joueur reseau");
		this.setLayout(new GridLayout(2,1));
		initComposants();
		this.setLocationRelativeTo(null);
		this.setResizable(false);
		this.setVisible(true);	
	}

	private void initComposants() {
		
		JLabel nom = new JLabel("Nom : ");
		JTextField nomField = new JTextField();
		nomField.setPreferredSize(new Dimension(100,25));
		JButton valider = new JButton("Valider");
		JButton annuler = new JButton("Annuler");
		valider.addActionListener(new ValiderActionListener());
		annuler.addActionListener(new AnnulerActionListener());
		
		JPanel panelJoueur = new JPanel();
		JPanel panelValidation = new JPanel();
		panelJoueur.setPreferredSize(new Dimension(200,25));
		panelValidation.setPreferredSize(new Dimension(200,25));
		
		panelJoueur.add(nom);
		panelJoueur.add(nomField);
		
		panelValidation.add(valider);
		panelValidation.add(annuler);
		
		this.add(panelJoueur);
		this.add(panelValidation);
	}
	
	class ValiderActionListener implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent arg0) {
			
			
		}
		
	}	
	
	class AnnulerActionListener implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent arg0) {
			PartieReseauInfos.this.setVisible(false);
			
		}
		
	}
	
	
}
